package io.renren.modules.web.service.impl;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.web.dao.WebsiteMenuDao;
import io.renren.entity.WebsiteMenuEntity;
import io.renren.modules.web.service.WebsiteMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("websiteMenuService")
public class WebsiteMenuServiceImpl extends ServiceImpl<WebsiteMenuDao, WebsiteMenuEntity> implements WebsiteMenuService {
	@Autowired
	private WebsiteMenuService websiteMenuService;


	@Override
	public List<WebsiteMenuEntity> queryList() {
		List<WebsiteMenuEntity> list = baseMapper.selectList(new EntityWrapper<WebsiteMenuEntity>());
		return list;
	}

	@Override
	public List<WebsiteMenuEntity> querySonList() {
		List<WebsiteMenuEntity> list = baseMapper.selectList(new EntityWrapper<WebsiteMenuEntity>().eq("parent_id","3"));
		return list;
	}


	@Override
	public PageUtils queryPage(Map<String, Object> params) {
		Page<WebsiteMenuEntity> page = this.selectPage(
				new Query<WebsiteMenuEntity>(params).getPage(),
				new EntityWrapper<WebsiteMenuEntity>()
		);

		return new PageUtils(page);
	}
}
